package com.demo.study.base.jvm;

import com.demo.study.vos.Person;

/**
 * JVM双亲委派
 *
 * @author Baymax
 * @since 2021/4/12
 */
public class ClassLoadDemo01 {
    public static void main(String[] args) {
        Person person = new Person();
        Class<? extends Person> personClass = person.getClass();
        // 双亲委派机制
        System.out.println(personClass.getClassLoader()); // Launcher$AppClassLoader
        System.out.println(personClass.getClassLoader().getParent()); // Launcher$ExtClassLoader
        System.out.println(personClass.getClassLoader().getParent().getParent()); // null（Boot）
    }
}